import request from '../api/request';

// 分类管理API
export function getCategories() {
  return request({
    url: '/admin/categories',
    method: 'get'
  });
}

export function createCategory(data) {
  return request({
    url: '/admin/categories',
    method: 'post',
    data
  });
}

export function updateCategory(id, data) {
  return request({
    url: `/admin/categories/${id}`,
    method: 'put',
    data
  });
}

export function deleteCategory(id) {
  return request({
    url: `/admin/categories/${id}`,
    method: 'delete'
  });
}

export function getCategoryDetail(id) {
  return request({
    url: `/admin/categories/${id}`,
    method: 'get'
  });
}

